<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.sql.*"%>
<%@ page import="com.model.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../css/css.css" rel="stylesheet" type="text/css" />
<link href="../css/style.css" rel="stylesheet" type="text/css" />
<title>物品总表</title>
</head>
<%
	Connection con = DataBase.getConnection();
	PreparedStatement pstmt1 = con.prepareStatement("SELECT * FROM item WHERE amount>0");
	PreparedStatement pstmt2 = con.prepareStatement("SELECT * FROM item WHERE amount<0.00001");
%>
<body class="ContentBody">
	<table style="width: 100%; height: 100%;" border="1px"
		cellspacing="0px" cellpadding="4px">
		<tr align="center">
			<td colspan="6"
				style="font-size: 16px; font-weight: 900;" class="tablestyle_title">物品总表</td>
		</tr>
		<tr style="width: 100%; height: 20px;" class="zsd"
			align="center">
			<td style="width: 35%">物品名称</td>
			<td style="width: 10%">物品品牌</td>
			<td style="width: 10%">库存数量</td>
			<td style="width: 10%">存放位置</td>
			<td style="width: 5%">管理员</td>
			<td style="width: 30%">备注</td>
		</tr>
		<%
		ResultSet rs = pstmt1.executeQuery();
		while( rs.next() ) {%>
		<tr>
			<td><%=rs.getString("name") %></td>
			<td><%=rs.getString("brand") %></td>
			<td><%=rs.getString("amount")+rs.getString("unit") %></td>
			<td><%=rs.getString("store") %></td>
			<td><%=rs.getString("person") %></td>
			<td><%=rs.getString("description") %></td>
		</tr>
		<%}
		rs.close();
		rs = pstmt2.executeQuery();
		while( rs.next() ) {%>
		<tr>
			<td><%=rs.getString("name") %></td>
			<td><%=rs.getString("brand") %></td>
			<td><%=rs.getString("amount")+rs.getString("unit") %></td>
			<td><%=rs.getString("store") %></td>
			<td><%=rs.getString("person") %></td>
			<td><%=rs.getString("description") %></td>
		</tr>
		<%}
		rs.close();
		%>
	</table>
</body>
<%
	con.close();
%>
</html>